export function covertZig (s: string, numRows: number): string {
    if (numRows === 1) return s;
    const strRows: string [] = [];
    for (let i = 0; i < numRows; i++) {
        strRows.push('');
    }
    let down = true;

    let i = 0;
    let curRow = 0;
    while (i < s.length) {
        strRows[curRow] += s[i];
        if (curRow === 0 || curRow === s.length-1) down = !down;
        curRow = curRow + (down ? 1 : -1);
    }

    return strRows.join('');
}